import localforage  from 'localforage';

const myIndexedDB = localforage.createInstance({
    name: 'myIndexedDB',
})

// 本地存储
const localName = "SST-";

export const localSet = (key, value) => {
    myIndexedDB.setItem(localName + key, value).catch(err => {
        console.log('localForage.setItem:',err);
    });
};
export const localGet = async (key) => {
    try {
        const value = await myIndexedDB.getItem(localName + key);
        return value || {};
    } catch (err) {
        console.log('localForage.getItem:',err);
    }
};
